#coding:utf-8
'''
class Student:
    pass
s = Student()
#如果对属性不设置私有，就可以随意更改属性,无法控制属性的范围
s.score = 200
print('学生分数为%d' %s.score)
'''
class Student:
    def __init__(self,score=0):
        self._score = score
    def getScore(self):
        return self._score
    def setScroe(self,value):
        if not isinstance(value,int):
            raise ValueError('分数必须为整数！')
        else:
            self._score = value
s1 = Student()
s1.setScroe(100)
print('学生分数为%d' %s1.getScore())